import { ApiProperty, OmitType } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import { PaymentOrder } from '../payment-order.entity';

export class AppleSubscribeDto {
  @ApiProperty({ description: '票据' })
  @IsString()
  appReceipt: string;
}

export class AppleRestoreSubscribeDto {
  @ApiProperty({ description: '交易事务id' })
  @IsString()
  transactionId: string;
}

/**
 * 创建订单 不需要传orderCode
 */
export class CreatePaymentOrderDto extends OmitType(PaymentOrder, [
  'createdAt',
  'updatedAt',
  'id',
  // 'orderCode',
  'transactionId',
  'payStatus',
  // 'appReceipt',
]) {}

export class AddPaymentOrderDto extends OmitType(PaymentOrder, [
  'createdAt',
  'updatedAt',
  'id',
  // 'orderCode',
]) {}
